<script setup lang="ts">
import {ref} from 'vue'
import child1 from './child1.vue';
import child2 from './child2.vue';
import child3 from './child3.vue';

let moneyData = ref([
  {id: 1, name: '张三', num: 100000},
  {id: 2, name: '李四', num: 100000},
  {id: 3, name: '王五', num: 100000}
])
</script>

<template>
  <div>
    <h3>默认插槽</h3>
    <child1>
      <a>111</a>
    </child1>

    <h3>具名插槽</h3>
    <child2>
      <template v-slot:a>
        <a>112</a>
      </template>
    </child2>

    <h3>作用域插槽</h3>
    <child3 :moneyData="moneyData">
      <template v-slot="{$row,$index}">
        {{$row.num}}
      </template>
    </child3>
  </div>
</template>

<style scoped>

</style>